|
 |
I can't find the thread that was talking about trees in Haskell vs trees in
an OO language, but...
I realized why I thought trees in an OO language have child nodes with null
branches - It's OO. You have pointers to things. In Haskell, it's expected
that when you add a new leaf down at the bottom of the tree, the root node
changes. In OO, you don't want to have to reassign all variables holding
pointers to the root when you add a leaf. And that applies recursively as
well. Even balancing a tree, you tend to rotate the child pointers rather
than reassign the parent pointer, per se.
So that's at least part of it.
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
 |